/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-03-10
 * Time: 22:14
 */
class Student {
    private String name;//学生姓名
    private int age;//学生年龄

    public void eat() {
        System.out.println("eat<>");
    }
    public void sleep() {
        System.out.println("sleep<>");
    }

    public void eat(String name,int age) {
        System.out.println("名字"+name+"年龄"+age);
    }

//    public String getName() {
//        return name;
//    }
//    public void setName(String name) {
//        this.name=name;
//    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Student student =new Student();
        student.eat("sfx",18);
        student.setName("sfx");
        System.out.println(student.getName());
    }
}
